function gewPhongKFMaterial(effect,name)
{ 
  // general properties
  gewMaterial.call(this,effect,name);
  this.shadowMap = null;
  this.texture = null;
  this.ambient = new gewVec3(1.,1.,1.);
  this.diffuse = new gewVec3(1.,1.,1.);
  this.specular = new gewVec3(1.,1.,1.);
  this.shininess = 10;
}
extend2(gewPhongKFMaterial,gewMaterial);
gewPhongKFMaterial.prototype.render = function()
{
  this.isRendering = true;
  // Render node list
  var tex = this.texture;
  var effect = this.effect;
  var scene3d = effect.scene3d;
  var gl = this.gl;
  var ambient = this.ambient;
  var diffuse = this.diffuse;
  var specular = this.specular;
  if(tex&&tex.isReady)
  {   
    gl.uniform1i(effect.texture0, 0);
    gl.uniform1i(effect.shadowMap, 1);
    gl.activeTexture(gl.TEXTURE0);
    gl.bindTexture(gl.TEXTURE_2D, tex.glName);
    gl.activeTexture(gl.TEXTURE1);
    gl.bindTexture(gl.TEXTURE_2D, this.shadowMap);
    gl.uniform3f(effect.ambient, ambient.x, ambient.y, ambient.z);
    gl.uniform3f(effect.diffuse, diffuse.x, diffuse.y, diffuse.z);
    gl.uniform4f(effect.specular, specular.x, specular.y, specular.z, this.shininess);
    var list  = this.nodeList;
    var listLen = list.length;
    // Send proj matrix & view pos
    //gl.uniformMatrix4fv(effect.viewMat, false, scene3d.viewMat.getGLArray());
    //gl.uniformMatrix4fv(effect.projectionMat, false, scene3d.projectMat.getGLArray());
    var viewPos = scene3d.viewPosition;
    gl.uniform3f(effect.viewPosition, viewPos.x, viewPos.y, viewPos.z);
    //var viewMat = scene3d.viewMat;
    //var projMat = scene3d.projectMat;
    var viewProjMat = scene3d.viewProjectMat;
    for (var i = 0; i < listLen; i++) 
    {
      var node = list[i];
      var modelViewProj = viewProjMat.mul(node.modelMat); //(viewMat.mul( node.modelMat)).mul(projMat);
      gl.uniformMatrix4fv(effect.modelViewProjectionMat, false, modelViewProj.data);
      var normalMat = node.modelMat.dup();
      normalMat.data[12] = 0;
      normalMat.data[13] = 0;
      normalMat.data[14] = 0;
      gl.uniformMatrix4fv(effect.normalMat, false, normalMat.data);
      gl.uniformMatrix4fv(effect.modelMat, false, node.modelMat.data);
      node.render(this);
    }
  }
  this.isRendering = false;
}
